// ================================================================================
// 		File: partyJoinPartyActivists.cs
// 		Desc: 
//  
// 		Called by:   
//               
// 		Auth: chenwenzhi（--）
// 		Date: 2015-12-28 23:59
// ================================================================================
// 		Change History
// ================================================================================
// 		Date:		Author:				Description:
// 		--------	--------			-------------------
//    
// ================================================================================
// --
// ================================================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace ZHDJ.Data.Models.JoinParty
{
    /// <summary>
    /// 
    /// </summary>   
    public class partyJoinPartyActivists
    {
        #region 属性
        [Key]
        public string ActivistsID { get; set; }
        /// <summary>
        /// StandID
        /// </summary>
        [StringLength(128)]
        public string StandID { get; set; }

        /// <summary>
        /// LoginID
        /// </summary>
        [StringLength(128)]
        public string LoginID { get; set; }

        /// <summary>
        /// Family
        /// </summary>
        public string Family { get; set; }

        /// <summary>
        /// Sociology
        /// </summary>
        public string Sociology { get; set; }

        /// <summary>
        /// WhereAndWhereReward
        /// </summary>
        public string WhereAndWhereReward { get; set; }

        /// <summary>
        /// WhereAndWhereParty
        /// </summary>
        public string WhereAndWhereParty { get; set; }

        /// <summary>
        /// CulturalRevolution
        /// </summary>
        public string CulturalRevolution { get; set; }

        /// <summary>
        /// CreateTime
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// FormerName
        /// </summary>
        [StringLength(512)]
        public string FormerName { get; set; }

        /// <summary>
        /// JoinTheYouthLeagueTime
        /// </summary>
        public DateTime? JoinTheYouthLeagueTime { get; set; }

        /// <summary>
        /// FamilyOrigin
        /// </summary>
        [StringLength(512)]
        public string FamilyOrigin { get; set; }

        /// <summary>
        /// PersonalConstituent
        /// </summary>
        [StringLength(512)]
        public string PersonalConstituent { get; set; }

        /// <summary>
        /// WorkTime
        /// </summary>
        public DateTime? WorkTime { get; set; }

        /// <summary>
        /// PresentOccupation
        /// </summary>
        [StringLength(512)]
        public string PresentOccupation { get; set; }

        /// <summary>
        /// ConfirmActivistsTime
        /// </summary>
        public DateTime? ConfirmActivistsTime { get; set; }
        /// <summary>
        /// 出生地
        /// </summary>
        public string Birthplace { get; set; }
        /// <summary>
        /// 有何专长
        /// </summary>
        public string Expertise { get; set; }
        /// <summary>
        /// 作为培养对象时间
        /// </summary>
        public DateTime? CultureTime { get; set; }

        #endregion

        /// <summary>
        /// 根据流程ID获取ActivistsID
        /// </summary>
        /// <param name="StandID">流程ID</param>
        /// <returns></returns>
        public static string GetActivistsIDByStandID(string StandID)
        {
            string ActivistsID = string.Empty;
            string sql = string.Format(@"select ActivistsID from tblpartyJoinPartyActivists where StandID='{0}' order by CreateTime desc limit 1", StandID);
            object obj = MySqlHelper.ExecuteScalar(sql);
            if (obj != null)
            {
                ActivistsID = obj.ToString();
            }
            return ActivistsID;
        }
    }
}
